function quickSort(arr=[]){ //
    let {length} = arr;

    if(length <= 1){ //1.数组只有一个的情况下，就不自调用
        return arr
    }

    let povit = arr[0];  //基准点

    let left = [];  //比基准点小的放在left数组内

    let right = []; //比基准点大的放在right数组内

    for(let i = 1;i<length;i++){ //基准点不再参与比较，从下标为1的开始
        if(arr[i] >= povit){
            right.push(arr[i])
        }else{
            left.push(arr[i])
        }
    }

    console.log(left,right)

    let l = quickSort(left);
    let r = quickSort(right);
    return l.concat(povit).concat(r)
}

console.log(quickSort([3,4,6,3,2,1]))